@use 'sass:color';

@mixin make-theme($name, $primary, $primary-dark) {
  .config-ui-x-#{$name} {
    pre {
      background-color: #eaeaea;
      color: #333333;
      text-align: left;
      padding: 15px !important;
      border-radius: 10px;
    }

    .form-control::placeholder {
      color: #cdcdcd !important;
      opacity: 1 !important;
    }

    input[readonly] {
      background-color: #eeeeee;
      cursor: not-allowed;
    }

    .sidebar {
      background: $primary-dark;
      color: #eeeeee;

      .header {
        background: $primary-dark;
      }

      .link-wrapper {
        scrollbar-color: $primary transparent;

        .link {
          .link-row {
            &:hover {
              background: $primary;

              .title {
                color: #ffffff;
              }
            }

            &.active {
              i {
                color: $primary;
              }
            }

            &.active:hover {
              i {
                color: #ffffff;
                transition: 0.3s;
              }
            }

            .title {
              color: #ffffff;
              font-weight: 300;
            }
          }
        }
      }
    }

    .m-header {
      background: $primary-dark;
    }

    .search-bar {
      border: 0 !important;
      background-color: #eeeeee !important;
    }

    .primary-text {
      color: $primary;
    }

    .grey-text,
    .grey-text a {
      color: #666666 !important;
    }

    .btn-primary,
    .btn-default {
      background-color: $primary !important;
      border-color: $primary !important;

      &:hover,
      &:focus {
        background-color: color.adjust($primary, $lightness: -5%) !important;
        border-color: color.adjust($primary, $lightness: -5%) !important;
        transition: background-color 0.25s;
      }
    }

    .badge-primary {
      background-color: $primary-dark !important;
    }

    a {
      &.card-link {
        color: #000000;

        @media (hover: hover) {
          &:hover {
            color: $primary !important;
          }
        }
      }
    }

    .icon-button {
      cursor: pointer;
      @media (hover: hover) {
        &:hover {
          color: $primary !important;
        }
      }
    }

    .hb-uix-switch {
      .hb-uix-slider {
        border-color: $primary !important;
      }

      input:checked ~ .hb-uix-slider {
        background-color: $primary !important;
      }
    }

    .rendux-input:checked + label {
      background: $primary-dark !important;
    }

    .qr-code-container {
      svg {
        fill: $primary-dark;
      }
    }

    .qr-code-theme-color {
      stroke: $primary-dark !important;
    }

    .hb-widget-chart-background {
      background-color: rgba($primary-dark, 0.2);
      display: none;
    }

    .animate_loader {
      .spinner_outer {
        stroke: $primary-dark;
      }
      .spinner_inner {
        stroke: $primary;
      }
    }

    .login-container {
      background-color: $primary-dark !important;
    }

    .alert {
      color: #000000;
      background-color: #eeeeee;
      border-color: #cccccc;

      a {
        color: $primary;
      }
    }

    .alert-info {
      border-color: $primary;
    }

    .alert-warning {
      border-color: #ffa000;
    }

    .alert-error {
      border-color: #d32f2f;
    }

    .plugin-icon-card {
      width: 70px;
      height: 70px;
      border-radius: 15px;
      border: 1px solid rgba(0, 0, 0, 0.125);
    }

    @media (max-width: 991px) {
      .plugin-icon-card {
        width: 60px;
        height: 60px;
      }
    }

    .accordion {
      border: 1px solid rgba(0, 0, 0, 0.125);
      border-radius: 0.5rem;

      .card-header {
        background: #ffffff;
      }
    }

    .accordion-header {
      border-radius: 0.5rem;
      --bs-card-border-radius: 0 !important;
    }

    .accordion-body {
      padding-top: 0;
      padding-bottom: 0;
    }

    .gradient {
      background: linear-gradient(130deg, $primary, #4a266c, $primary-dark);
    }

    .grey-outline {
      border: 1px solid #cccccc;
      border-top: 0;
      border-bottom-left-radius: 0.25rem;
      border-bottom-right-radius: 0.25rem;
    }

    .plugin-modal-body {
      .tab-content {
        background: #efefef;
        margin-top: 0 !important;
      }
      .nav-tabs .nav-link.active {
        background-color: #efefef;
      }
    }

    .release-tab {
      color: #333333 !important;
    }
  }
}

@include make-theme('orange', #ff9800, #ef6c00);
@include make-theme('red', #f44336, #d32f2f);
@include make-theme('pink', #e91e63, #c2185b);
@include make-theme('purple', #9c27b0, #421367);
@include make-theme('deep-purple', #673ab7, #4527a0);
@include make-theme('indigo', #3f51b5, #303f9f);
@include make-theme('blue', #4949af, #000070);
@include make-theme('blue-grey', #607d8b, #455a64);
@include make-theme('cyan', #00bcd4, #00838f);
@include make-theme('green', #4caf50, #388e3c);
@include make-theme('teal', #009688, #00695c);
@include make-theme('grey', #9e9e9e, #616161);
@include make-theme('brown', #795548, #4e342e);
